home *** CD-ROM | disk | FTP | other *** search
/ Hottest 6 / Hottest 6 (1996)(PDSoft)[!].iso / software / videoutils / h-m / mainactor / rexx / scale_adpro.ma < prev    next >
Text File  |  1978-11-24  |  3KB  |  138 lines

  1. /*
  2.  *
  3.  *     Scale V 1.0, 1993 Markus Moenig
  4.  *
  5.  *     Scales the source project to a requested size, needs AdPro !!
  6.  *     The new project gets the name of the source project + ".new"
  7.  *     and is also converted to the saver module type of the source project.
  8.  *
  9.  *     The loader/saver of the source project can be either picture
  10.  *     or animation modules.
  11.  *
  12.  *     A new project will be opened for the resulting pictures/animation.
  13.  */
  14.  
  15. OPTIONS RESULTS
  16.  
  17. ADDRESS MAINACTOR 
  18.  
  19. ScreenToFront
  20. PrintAndStoreTXT "Scale V1.0, scaling project ..."
  21.  
  22. IF ~SHOW('P','ADPro') THEN DO  /* if not allready running, start adpro */
  23.     ADDRESS MAINACTOR PrintTXT "Invoking AdPro ..."
  24.     ADDRESS COMMAND 'run >NIL: <NIL: adpro:adpro BEHIND MAXMEM=1000000'
  25.     ADDRESS COMMAND Wait 5
  26. END  
  27.  
  28. ADDRESS MAINACTOR
  29.  
  30. GetSPName
  31.  
  32. IF rc = 0 THEN DO                          /* check if project loaded */
  33.  
  34.     PARSE VAR RESULT firstname secondname .  /* store name of the animation */
  35.                                              /* or the names of the picture list */
  36.     ScreenToFront
  37.  
  38.     DeSelectAll
  39.  
  40.     GetSPSaver
  41.     PARSE VAR RESULT savertype savername .   /* store type, name of saver module */
  42.  
  43.                                            /* Store general infos of the project */
  44.     GetSPInfo
  45.     PARSE VAR RESULT width height colors pics caching loop cpf .
  46.  
  47.     RequestInteger width "Enter new Width"
  48.     IF RC = 10 THEN DO
  49.         PrintTXT "Aborting ..."
  50.         EXIT
  51.     END
  52.     newxsize=RESULT
  53.  
  54.     RequestInteger height "Enter new Height"
  55.     IF RC = 10 THEN DO
  56.         PrintTXT "Aborting ..."
  57.         EXIT
  58.     END
  59.     newysize=RESULT
  60.     Scale=newxsize || " " || newysize
  61.  
  62.     IF savertype = "PIC" THEN
  63.         picformat=savername
  64.     ELSE DO
  65.         picformat=IFF
  66.         SetSPSaver PIC picformat
  67.     END
  68.     
  69.     ADDRESS "ADPro"
  70.         LFormat "Universal"
  71.         PSTATUS UNLOCKED
  72.         ORIENTATION PORTRAIT
  73.         SFormat picformat
  74.  
  75.     ADDRESS MAINACTOR
  76.  
  77.     newname = firstname || ".new"            /* new name = old one + ".new" */
  78.  
  79.     SelectAll
  80.     
  81.     saveargs=newname
  82.         
  83.     Save saveargs                            /* Save Pictures */
  84.  
  85.     DO i=1 to pics                           /* Scale all pics */
  86.  
  87.         actualpic=newname || "." || Right("00000" || i, 5)
  88.     PrintTxt "ADPro scales Picture" i
  89.  
  90.         ADDRESS "ADPro"    
  91.         Load actualpic
  92.         RENDER_TYPE colors
  93.         ABS_SCALE Scale
  94.         PSORT 0
  95.         Execute    
  96.         Save actualpic IMAGE
  97.  
  98.         ADDRESS MAINACTOR
  99.  
  100.     END
  101.  
  102.     IF caching = "CACHING=YES" THEN                 /* Was the old project cached ? */
  103.         
  104.         OpenNewProject "CACHING"               /* If yes new project is also cached */
  105.     
  106.     ELSE 
  107.         
  108.         OpenNewProject                         /* If not new project is not cached */
  109.  
  110.     SetSPLoader PIC picformat                /* Set the new projects loader module */
  111.  
  112.     firstpic=newname || "." || Right("00000" || 1, 5)
  113.     lastpic=newname || "." || Right("00000" || pics, 5)
  114.  
  115.     LoadProject firstpic lastpic             /* Load picture list */
  116.  
  117.     SetSPSaver savertype savername
  118.  
  119.     IF savertype = "ANIM" THEN DO            /* If we wanted a new animation, */
  120.                                              /* we have to build it */
  121.         SelectAll
  122.         saveargs=newname || " " || cpf || " " || loop
  123.         Save saveargs
  124.         UnloadProject
  125.         
  126.         DO i=1 TO pics                         /* delete temporary pics */
  127.             actualpic=newname || "." || Right("00000" || i, 5)
  128.             PrintTxt "Delete " || actualpic
  129.             ADDRESS COMMAND    "delete " || actualpic
  130.         END
  131.         
  132.         SetSPLoader savertype savername
  133.         LoadProject newname
  134.     END
  135.     
  136.     PrintAndStoreTXT "READY !!!!"
  137. END
  138.